/*
 * ThreadHeaderListView.java
 *
 * Created on 2008/09/05 +0900
 *
 * $Revision: 58 $
 * $Date: 2008-12-06 08:59:45 +0000 (Sat, 06 Dec 2008) $
 */

package org.gikolet.bbs.ui;

import org.gikolet.bbs.data.ThreadHeader;
import org.gikolet.bbs.reader.BbsReaderProvider;
import org.gikolet.framework.inject.Injector;
import org.gikolet.framework.inject.Serviceable;
import org.gikolet.framework.ui.Container;
import org.gikolet.framework.ui.List;
import org.gikolet.framework.util.Assert;
import org.gikolet.framework.view.AbstractView;

/**
 * @author tetsutaro (latest modification by $Author: tetsutaro.ss $)
 * @version $Revision: 58 $ $Date: 2008-12-06 08:59:45 +0000 (Sat, 06 Dec 2008) $
 */
public abstract class ThreadHeaderListView extends AbstractView implements
	Serviceable {

    private Injector injector;

    private ThreadHeader threadHeader;

    private List list;

    /**
     * @see org.gikolet.framework.inject.Serviceable#service(org.gikolet.framework.inject.Injector)
     */
    public void service(Injector injector) {
	this.injector = injector;
    }

    protected Injector getInjector() {
	Assert.isNotNull(this.injector);

	return this.injector;
    }

    public ThreadHeader getThreadHeader() {
	return this.threadHeader;
    }

    public void setThreadHeader(ThreadHeader threadHeader) {
	Assert.isNotNull(threadHeader);

	this.threadHeader = threadHeader;
    }

    public void update() {
	BbsReaderProvider readerProvider = (BbsReaderProvider) getInjector()
		.getInstance(BbsReaderProvider.class);

	// ThreadHeaderReader reader = readerProvider
	// .createThreadHeaderReader(board);

    }

    public void createPartControl(Container parent) {
	this.list = new List();

	this.list.add("テスト1");
	this.list.add("テスト2");

	parent.add(this.list);
    }

    public void setFocus() {
	this.list.setFocus();
    }
}
